package com.vigor.bear.web.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.vigor.bear.web.service.StudentService;

@Controller
@RequestMapping("/course")
public class CourseController extends BaseController {

	private static final Logger logger = Logger
			.getLogger(CourseController.class);

	@Autowired
	private StudentService ssv;

	@InitBinder("course")
	public void initUserBinder(WebDataBinder binder) {
		binder.setFieldDefaultPrefix("course.");
	}

	@RequestMapping(method = RequestMethod.GET)
	public String view(Model model) {
		return "course/management/list";
	}
	
	@RequestMapping(value = "/create", method = RequestMethod.GET)
	public String create(Model model){
		return "course/management/add";
	}

	@RequestMapping(value = "/manager/{cid}", method = RequestMethod.GET)
	public String manager(@PathVariable("cid") String cid, Model model) {
		logger.info("课程ID>" + cid);
		return "course/management/manager";
	}

}
